

function jTABLE(){
	
	this.className 		= null;
	this.id				= null;
	this.border			= 0;
	this.cellSpacing 	= 0;
	this.cellPadding	= 0;
	this.headers		= new Array();
	this.rows			= new Array();
	this.table			= null;
	
	//Adding a Row jQuery Object
	this.addRow  = function(row){
		this.rows.push(row);
	};
	/*
	this.getCode = function(){
		for (var i=0;i<this.rows;i++){
			rowCodes += this.rows[i].getCode();
		}
		return '<table class="'+this.className+'">'+rowCodes+'</table>';
	}
	*/
	
	this.getTABLE = function(){
		this.table = $('<table/>',{
					  'class': this.className,
					  'id':this.id
					});
		
		for (var i=0;i<this.rows.length;i++){
			this.table.append(this.rows[i].getTR());
		}
		return this.table;
	};
}

function jTR(){
	
	this.cells 	= new Array();
	this.tr		= null;
	
	this.addCell = function(cell){
		this.cells.push(cell);
	};
	
	this.getTR = function(){
		this.tr = $('<tr/>');
		for (var i=0;i<this.cells.length;i++){
			this.tr.append(this.cells[i].getTD());
		}
		return this.tr;
	};
}

function jTH(){
	this.className	= null;
	this.value		= null;
	this.action		= null;
	this.td			= null;
	this.id			= null;
	this.cellType   = "th";
	this.width		= null;
	this.setStyle	= null;
	
	this.setValue = function(value){
		this.value = value;
	};
	
	this.setWidth	= function(value){
		this.width = value;
	};
	
	this.setStyle	= function(style){
		this.style = style;
	};
	
	this.setClassName = function(className){
		this.className = className;
	};
	
	this.getTD = function(){
		this.td = $('<'+this.cellType+'/>',{
			'class':this.className,
			'id':this.id,
			'style':this.style
		});
		
		if (this.value instanceof jQuery){
			this.td.append(this.value);
		}
		else {
			this.td.text(this.value);
		}
		return this.td;
	};
}

function jTD(){
	this.inheritFrom = jTH;
	this.inheritFrom();
	this.cellType   = "td";
	
}